#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 3e5+10;
long long ans[maxn];
void init()
{
	ans[1] = 0;
	for(long long i = 2;i<maxn;i++)
	{
		ans[i] = ans[i-1]+(((i-1)*2-1)*4+4)*(i-1);	
	}
}
int main()
{
	init();
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n;
		scanf("%d",&n);
		printf("%lld\n",ans[(n+1)/2]);
	}
}
